﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;

namespace BLL.BudgetService
{
    /// <summary>
    /// 检查是否存在制定月份的预算清单
    /// </summary>
    public class CheckMonthBudgetExistTransaction : QueryBudgetTransaction
    {
        public CheckMonthBudgetExistTransaction(int _Year,int _Month)
        {
            year = _Year;
            month = _Month;
        }

        private int year;
        private int month;

        public bool IsExist
        {
            get
            {
                base.Execute();
                IList<T_BudgetObject> budgets = base.budgets;
                foreach (T_BudgetObject item in budgets)
                {
                    if (item.Db_BeginDate.Year == year && item.Db_BeginDate.Month == month)
                    {
                        return true;
                    }
                }
                return false;
            }
        }
        
    }
}
